<%
		String searchString = request.getParameter("searchString");
%>
<%
		if("C".equalsIgnoreCase(searchString.substring(0,1))) {
			//必须限制只能输入三位数字
			//防止sql注入
			Enterprise enterprise = EnterpriseService.$.getEnterpriseById(Integer.parseInt(searchString.substring(1)));
			out.println(searchString + ":");
%>
			<a href="javascript:;" onclick="alert('next iterator,please try the employee level')"><%= enterprise == null ? "no found" : enterprise.getName() %></a>
<% 
		}
%>

<%
		if("E".equalsIgnoreCase(searchString.substring(0,1))) {
			//必须限制只能输入三位数字
			//防止sql注入
			Employee employee = EmployeeService.$.getEmployee(Integer.parseInt(searchString.substring(1)));
			out.println(searchString + ":");
			if(employee != null) {
%>
			<a href="javascript:;" onclick="toEmployee(this)" value="<%= "E" + employee.getEmployeeId()%>"><%= employee == null ? "no found" : employee.getName() %></a>
<% 
			} else {
%>
			No result.
<%
			}
		}
%>

<%
		if("SG".equalsIgnoreCase(searchString.substring(0,2))) {
			Salaryserviceemployee salaryService = SalaryServiceService.$.getSalaryService(Integer.parseInt(searchString.substring(2)));
			if(salaryService != null) {
				Employee employee = SalaryServiceService.$.getEmployee(salaryService);
				Enterprise enterprise = employee.getEnterprise();
				out.println(searchString + ":");
%>
				<span>所属企业：<%= enterprise.getName() %></span><br/>
				<span>所属人才：<%= employee.getName() %></span><br/>
				<span>服务名称：<%= salaryService.getBaseWage() %></span>
			
<% 
			} else {
%>
			No result.
<%
			}
		}
%>

<%
		if("ST".equalsIgnoreCase(searchString.substring(0,2))) {
%>
			No result.
<%
		}
%>

<script type="text/javascript">
<!--

//-->
			toEmployee = function(oElem) {
					var aLink = oElem;
					var url = 'la_employee_list.jsp';
					var pars = "employeeid="+ aLink.getAttribute('value');
					var myAjax = new Ajax.Updater('right',url,{method:'get', parameters: pars,  evalScripts: true});
			}
</script>

<%@ page import="com.esms.bean.*"  %>
<%@ page import="com.esms.struts.service.*"%>
<%@ page contentType="text/html;charset=utf-8" %>